public class code5 {
    public static int countPos(int n){
        if(n<10)
            return n;
        else {
            return n%10+countPos(n/10);
        }
    }
    public static void main(String[] args) {
        System.out.println(countPos(1721));
    }
}
